import request from '@/utils/request'

const api_name = '/copyrightin/batch'

export default {
  // ## 动态条件查询带分页
  query(pageNo, pageSize, batchQuery) {
    return request({
      url: `${api_name}/${pageNo}/${pageSize}`,
      method: 'post',
      data: batchQuery
    })
  },
  add(batch) {
    return request({
      url: `${api_name}/saveBatch`,
      method: 'post',
      data: batch
    })
  },
  // 修改
  update(batch) {
    return request({
      url: `${api_name}/updateBatch`,
      method: 'put',
      data: batch
    })
  },
  // 回显
  view(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'get'
    })
  },
  delete(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'delete'
    })
  },
  upOrDownBook(id, online) {
    return request({
      url: `${api_name}/upOrDownBook/${id}/${online}`,
      method: 'put'
    })
  },
  viewSecondSort(secondId) {
    return request({
      url: `${api_name}/viewSecondSort/${secondId}`,
      method: 'get'
    })
  }
}

